<?php

namespace Jb\Utils;

use Jb\Object;

class AbstractCollection extends Object implements Collection {

    protected $collectionStorage;

    public function __construct() {
        $this->collectionStorage = new \SplObjectStorage();
    }

    public function add(Object $collectionObject) {
        $this->collectionStorage->attach($collectionObject);
    }

    public function remove(Object $collectionObject) {
        $this->collectionStorage->detach($collectionObject);
    }

    public function getIterator() {
        return $this->collectionStorage;
    }

}
?>
